package me.m1key.springtx;

import me.m1key.springtx.beans.DogsBean;
import me.m1key.springtx.entities.Dog;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Launcher {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		ApplicationContext appContext = new ClassPathXmlApplicationContext(
				new String[] { "applicationContext.xml" });
		DogsBean dogsBean = appContext.getBean("dogsBean", DogsBean.class);

		Dog doggie = new Dog();
		doggie.setName("Sega");

		System.out.println("Any dogs: " + dogsBean.containsDogs());
		dogsBean.persistDog(doggie);
		System.out.println("Any dogs: " + dogsBean.containsDogs());
	}

}
